home *** CD-ROM | disk | FTP | other *** search
- Path: nwgw.infi.net!usenet
- From: elc@fay.infi.net (Lee Carpenter)
- Newsgroups: comp.lang.c++
- Subject: Need suggestions for memory allocation - Please help...
- Date: 2 Mar 1996 07:04:03 GMT
- Organization: InfiNet
- Message-ID: <4h8rt3$9fe@nw003.infi.net>
- NNTP-Posting-Host: pa2dsp20.fay.infi.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- I am an amateur C programmer and have been trying to teach myself C++. I
- have recently wrote a simple database-like program for a specific purpose.
- The problem is that this purpose uses huge records (2K+ per record). I am
- using a linked-list format and using 'new' to allocate memory for each new
- record. I am also using the compact memory model (1MB for the data
- section). Everything compiles fine, but when I enter about 25 records or
- so, 'new' returns a NULL pointer telling me I'm out of memory. When I
- traced through the program, I found that 'new' was allocating memory near
- the end of the 1MB segment and rapidly running out of memory. Why is
- this? Is there any way I can make 'new' use more of the 1 MB of memory?
- If not, is there any way I can use extended/expanded memory for data
- allocation? I'm not sure which direction to pursue. Any advise or help
- would be greatly appreciated.
-
- Thanks in advance,
- Lee
- elc@fay.infi.net
-
-